﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载"/>
    <meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。"/>
    <link href="/images/favicon.ico" rel="Bookmark"/>
    <link href="/images/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>

    <link href="/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css"/>
    <link href="/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css"/>
    <link href="/h-ui.admin/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css"/>

    <script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="/lib/layer/2.4/layer.js"></script>
    <script type="text/javascript" th:src="@{/h-ui/js/H-ui.min.js}"></script>
    <script type="text/javascript" src="/h-ui.admin/js/H-ui.admin.js"></script>
    <script type="text/javascript" src="/js/query.js"></script>
    <script type="text/javascript" src="/lib/My97DatePicker/4.8/WdatePicker.js"></script>
    <script type="text/javascript" src="/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
    <script type="text/javascript" src="/lib/jquery.validation/1.14.0/validate-methods.js"></script>
    <script type="text/javascript" src="/lib/jquery.validation/1.14.0/messages_zh.js"></script>

    <script type="text/javascript" th:src="@{/lib/jquery.contextmenu/jquery.contextmenu.r2.js}"></script>

    <title>后台登录 -</title>

</head>
<body>

<input type="hidden" id="TenantId" name="TenantId" value=""/>
<div class="header"></div>
<!-- <div class="header"><h2 style="color:white">&nbsp;杭州熙子官网后台管理系统</h2></div> -->
<div class="loginWraper">
    <div class="loginBox">
        <form class="form form-horizontal" id="loginForm" th:action="@{/back/login}" method="post">
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                <div class="formControls col-xs-8">
                    <input id="loginId" name="loginId" type="text" placeholder="账户" class="input-text size-L"/>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                <div class="formControls col-xs-8">
                    <input id="loginPwd" name="loginPwd" type="password" placeholder="密码" class="input-text size-L"/>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <input class="input-text size-L" id="code" name="yzmCode" type="text" placeholder="验证码"
                           onblur="if(this.value==''){this.value='验证码:'}"
                           onclick="if(this.value=='验证码:'){this.value='';}" value="验证码:" style="width:150px;"/>
                    <a id="kanbuq" href="javascript:;" onclick="refresh()"><img id="codeimage" src="/image"/>
                        看不清，换一张</a></div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <label for="online">
                        <input type="checkbox" name="online" id="online" value=""/>
                        使我保持登录状态</label>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <a href="javascript:;" onclick="login()" class="btn btn-success radius size-L">登&nbsp;&nbsp;陆</a>

                    <input name="" type="reset" class="btn btn-default radius size-L"
                           value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;"/>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="footer">Copyright @ 杭州熙子</div>
<input type="text" id="msg" th:value="${msg}"/>

</body>
</html>
<script type="text/javascript">
    $(function () {
        //debugger;
        var msg = $('#msg').val();
        if (msg != "") {
            layer.msg(msg, {icon: 2, time: 1000});
        }

        document.onkeydown = function (e) {
            var ev = document.all ? window.event : e;
            if (ev.keyCode == 13) {
                login();
            }
        }
    });

    function refresh() {
        document.getElementById("codeimage").src = "/image?" + Math.random();
    }

    function login() {
        var loginId = $("#loginId").val();
        var pwd = $("#loginPwd").val();
        var code = $("#code").val();

        if (loginId == "" || loginId.length == 0) {
            layer.msg("请输入账号!", {icon: 5, time: 2000});
            return;
        }
        if (pwd == "" || pwd.length == 0) {
            layer.msg("请输入密码!", {icon: 5, time: 2000});
            return;
        }
        if (code == "验证码" || code == "" || code.length == 0) {
            layer.msg("请输入验证码!", {icon: 5, time: 2000});
            return;
        }
        $('#loginForm').submit();
    }
</script>
